using SqlSugar;
using System;
using System.Collections.Generic;

namespace WorkflowApi.Models
{
    [SugarTable("WorkflowDefinition")]
    public class WorkflowDefinitionEntity
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
        public string Id { get; set; } = string.Empty;
        public string Name { get; set; } = string.Empty;
        public string Description { get; set; } = string.Empty;
        public string Version { get; set; } = "1.0";
        public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
        public bool IsActive { get; set; } = true;
        public string StepsJson { get; set; } = string.Empty; // 步骤JSON
    }

    [SugarTable("WorkflowInstance")]
    public class WorkflowInstanceEntity
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
        public string Id { get; set; } = string.Empty;
        public string DefinitionId { get; set; } = string.Empty;
        public string Status { get; set; } = "Running";
        public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
        public DateTime? CompletedAt { get; set; }
        public string CreatedBy { get; set; } = string.Empty;
        public string DataJson { get; set; } = string.Empty; // 实例数据JSON
    }

    [SugarTable("WorkflowTask")]
    public class WorkflowTaskEntity
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
        public string Id { get; set; } = string.Empty;
        public string InstanceId { get; set; } = string.Empty;
        public string StepId { get; set; } = string.Empty;
        public string Assignee { get; set; } = string.Empty;
        public string Status { get; set; } = "Pending";
        public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
        public DateTime? CompletedAt { get; set; }
        public string? Comment { get; set; }
        public string? Action { get; set; }
    }
} 